package com.ftg.learn.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 添加关于web部分的处理功能
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/4/26 上午9:57
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //启动logs守卫
        registry.addInterceptor(new LogsControllerGuard())
                .addPathPatterns("/api/**");
//                .excludePathPatterns("/css/**", "/js/**", "/images/**", "/fonts/**", "/webjars/**", "/favicon.ico")
//                .excludePathPatterns("/doc.html", "/swagger-resources/**", "/v2/api-docs", "/v3/api-docs", "/configuration/**", "/webjars/**");
    }
}
